package com.kailong.servlet.seat;

import com.kailong.dao.admin.ManageSeatDao;
import com.kailong.pojo.Seat;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet("/admin/doUserDel")
public class DoUserDel extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException{
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        //获取编号
        String tno = request.getParameter("tno");
        int count = ManageSeatDao.del(tno);
        if(count>0){
            response.sendRedirect("seatSelectAll?cp=" + request.getParameter("cpage"));
        }else {
            PrintWriter out = response.getWriter();
            out.write("<script>");
            out.write("alert('用户删除失败')");
            out.write("location.href='seatSelectAll?cp=" + request.getParameter("cpage")+"'");
            out.write("<script>");
        }


    }
}
